<?php

namespace app\common\validate\Business;

use think\Validate;

class Business extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'mobile'   => ['require', 'number', 'unique:business', 'regex:/(^1[3|4|5|7|8][0-9]{9}$)/'],
        'password' => 'require',
        'salt' => 'require',
    ];


    /**
     * 提示消息
     */
    protected $message = [
        'mobile.require' => '手机号必填',
        'mobile.unique' => '手机号已存在，请重新输入',
        'password.require'  => '密码必填',
        'salt.require'      => '密码盐必填',
    ];
     /**
     * 验证场景
     */
    protected $scene = [

        //修改个人资料
        'profile' => ['mobile']
    ];

}
